using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.ComponentModel;
using PHSRAG.Insight21.Reports;
using System.Collections;
using System.Text;

namespace PHSRAG.Insight21.ClinicalTrials
{ 

    /// <remarks>Class for generating Financial Summary report</remarks>
    public class sqlClinicalTrialReport:sqlReport
    {
        public sqlClinicalTrialReport(string pageUrl)
            : base(pageUrl)
        {
            doHashtable = true;

        }

        public override bool doCustomExcelReport
        {
            get
            {
                if (ReportName.ToLower() == ReportFactory.ct_ExternalOutput)
                {
                    return true;
                }
                return false;
            }
            set
            {
                base.doCustomExcelReport = value;
            }
        }
        /// <summary>
        /// over ride parent method
        /// </summary>
        public override Hashtable setParameterHTable(ref string rptName)
        {
            Hashtable tbl = new Hashtable();

            Budget budget = (Budget)cachePolicy.GetCachedObject(Budget.CacheKey);

            if (budget != null)
            {
                tbl.Add("BudgetId", budget.Id.ToString());
            }
            else
            {
                throw new Exception("Budget Id Not Specified. Please contact the Administrator");
            }


            tbl.Add(SSRSRequest.ReportParameterKeys.UserName, userContext.LastName + "," + userContext.FirstName); //username
            tbl.Add(SSRSRequest.ReportParameterKeys.WebUrl, Utility.Settings.GetKeyValue("weburl", "http://insight2.partners.org")); //Domain User Id

            return tbl;
        }

 
    }

}